package com.zz.TimeAdd.Instant;

import java.time.Instant;

public class Test {
    public static void main(String args[]){
        //1.创建Instant的对象，获取此刻时间信息
        Instant now = Instant.now();

        //2.获取总秒数
        long second = now.getEpochSecond();
        System.out.println(second);

        //3.不够1的纳秒数
        int nano = now.getNano();
        System.out.println(nano);

        System.out.println(now);

        Instant instant = now.plusNanos(111);


        //Instant对象的作用，做代码的性能分析，记录用户的操作某个事件的时间点
        Instant now1 = Instant.now();
        //代码执行
        Instant now2 = Instant.now();
    }
}
